

<cfif isdefined("session.ReceiptNum")>
<CFQUERY NAME="getorders" DATASOURCE="#dsn#">
select *
from tblorders
where ReceiptNum = #session.ReceiptNum#
</CFQUERY>

<CFQUERY NAME="getitems" DATASOURCE="#dsn#">
select *
from tbltransactions, tblproducts
where ReceiptNum = #session.ReceiptNum# and tbltransactions.ProdID = tblproducts.ProdID
</CFQUERY>

<!---<CFQUERY NAME="getitemssum" DATASOURCE="#dsn#">
select sum(Price) as total
from tbltransactions
where ReceiptNum = #session.ReceiptNum#
</CFQUERY>--->

<CFQUERY NAME="getitemssum" DATASOURCE="#dsn#">
select sum(Price) as total, sum(TaxAmount) as taxtotal
from tbltransactions
where ReceiptNum = #session.ReceiptNum#
</CFQUERY>

<cfif #getitemssum.taxtotal# gt 0>

<cfset myamount = #getitemssum.total# + #getitemssum.taxtotal#>
<cfelse>
<cfset myamount = #getitemssum.total#>

</cfif>

</cfif>
<cfparam name="mycode" default="">


<cfoutput>
<cfif isdefined("url.response")>

<cfif #url.code# is 104 or #url.code# is 101>
<cfset mycode = "Yes">

<cfelse>
<cfset mycode = "No">


</cfif>
</cfif>

</cfoutput>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #FFFFFF;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1b3b63;
}
.style1 {
	font-size: 18px;
	font-weight: bold;
}
.style2 {
	font-size: 18px;
	font-weight: bold;
	color:#666666;
}
.style3 {font-size: 24px}

.style4 {
	font-size: 12px;
	font-weight: bold;
	color:#FF0000;
}
-->
</style></head>

<body onLoad="document.frm1.cc.focus()"><cfoutput>
      <table width="100%" border="0" cellspacing="2" cellpadding="2" height="358">
        <tr>
          <td width="41%" valign="top"><strong class="style1">Credit Card Payment</strong></td>
          <td width="59%" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" valign="top"><hr size="1" noshade="noshade" /></td>
        </tr>
        <cfif not isdefined("form.amountpaid")><tr>
          <td valign="top" class="style1">Total Amount</td>
          <td align="center" valign="top" class="style11"><label class="style1 style3">
            #lscurrencyformat(myamount)#
          </label></td>
        </tr></cfif>
        <tr>
          <td valign="top" class="style2"><cfif isdefined("url.response") and #mycode# eq "Yes">#url.response#<cfelse>
            <cfform method="post" action="../payment/par_cc_card_swipe.cfm" name="frm1" onsubmit="return ray.ajax()"><br /><cfif isdefined("url.response")><span class="style4">Error Code: #url.response#</span></cfif><table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td class="style1">INSERT CARD NOW</td>
  </tr>
  <tr>
    <td class="style11">
    <input name="cc" type="password" class="style2" id="text1" style="background-image:url(../images/fieldbg.png)" onchange="formSubmit()" size="30" /><input name="amount" type="hidden" value="#myamount#" />  </td>
  </tr>
</table></cfform></cfif></td>
          <td rowspan="2" align="center" valign="top"><br />
          <img src="../images/cards.png" width="263" height="50" /><br /></td>
        </tr>
        <tr>
          <td valign="top" class="style11"><label>
            
              <cfif #mycode# eq "Yes"><a href="../paperreceipt.cfm?ReceiptNum=#getorders.ReceiptNum#"><img src="../images/sm_print.png" border="0" /></a><a href="../killsession.cfm" target="_parent"><img src="../images/noreceipt.png" border="0" /></a></cfif>
       
          </label></td>
        </tr>
      </table>
   </cfoutput>
    </td>
    </tr>
</table>
</body>
</html>

<cfoutput>
<cfif #getorders.LastFour# gte 1>
<cflock timeout=20 scope="Session" type="Exclusive">

<cfset structdelete(SESSION, "ReceiptNum")>

<cfset structdelete(SESSION, "CARTID")>
<cfset structdelete(SESSION, "DODAAC")>



</cflock>
</cfif>

</cfoutput>